package com.kaibes.admin.api;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.kaibes.web.admin.AdminMenu;
import com.kaibes.web.admin.AdminMenuRes;

@Configuration
public class ApiLinkInit {
    
    private final static String KEY = "api-link-manage";

    @Bean
    public AdminMenu apiMenu() {
        AdminMenu menu = new AdminMenu();
        menu.setKey(KEY);
        menu.setName("接口模块");
        menu.setIcon("fas fa-link");
        menu.setHref("");
        menu.setSort(2);
        menu.setParentKey(AdminMenuRes.MENU_BASE);
        return menu;
    }
    
    @Bean
    public AdminMenu apiShowMenu() {
        AdminMenu apiManageMenu = new AdminMenu();
        apiManageMenu.setKey("show-apis");
        apiManageMenu.setName("接口查询");
        apiManageMenu.setIcon("fas fa-at");
        apiManageMenu.setHref("/admin/api-link/api");
        apiManageMenu.setSort(1);
        apiManageMenu.setParentKey(KEY);
        return apiManageMenu;
    }
    
    @Bean
    public AdminMenu linkShowMenu() {
        AdminMenu linkManageMenu = new AdminMenu();
        linkManageMenu.setKey("show-links");
        linkManageMenu.setName("链接查询");
        linkManageMenu.setIcon("fas fa-link");
        linkManageMenu.setHref("/admin/api-link/link");
        linkManageMenu.setSort(2);
        linkManageMenu.setParentKey(KEY);
        return linkManageMenu;
    }
    
}
